﻿ScanAlignRhino 1.0 - Scan alignment for Rhino
==============================================
Author: Daniil Angelo Bravi

What it does
------------
Aligns one object (SOURCE) to another (TARGET) by shape, using a rigid
alignment: rotation and translation only, no deformation and no scaling.
Works with meshes, polysurfaces (Breps) and surfaces in any combination
(e.g. a scanned mesh onto a CAD model).

Requirements
------------
- Windows
- Rhino 9 (tested). Rhino 8: not tested yet.

Folder contents
---------------
- ScanAlignRhino.rhp     -> the plug-in
- MathNet.Numerics.dll   -> required library (must be in the SAME folder as
                            the .rhp, otherwise the command fails)
- ScanAlignRhino.rui     -> toolbar with the ScanAlign button
- LICENSE-MathNet.txt    -> license of the MathNet.Numerics library (MIT)

Installation
------------
1. Before extracting: right-click the .zip file > Properties > tick "Unblock"
   > OK. (Windows blocks files downloaded from the internet and Rhino may not
   load the DLL.)
2. Extract the zip to a PERMANENT folder, for example
   C:\RhinoPlugins\ScanAlignRhino
   Do not leave it in Downloads or a temporary folder: Rhino always loads the
   plug-in from there.
3. Open Rhino and drag ScanAlignRhino.rhp into the Rhino window.
   (Alternatively: Tools > Options > Plug-ins > Install... and pick the .rhp)
4. Toolbar (optional): drag ScanAlignRhino.rui into the Rhino window, or open
   it from Tools > Toolbars.

Usage
-----
1. Type the command  ScanAlign  (or click the toolbar button).
2. "Pick TARGET (fixed)": choose the object that stays still.
3. "Pick SOURCE (moves)": choose the object to align.
4. Choose the quality: Fast / Balanced / Accurate.
5. Click "Align by shape". When finished you see RMS, median, p95 and the
   deviation from the target before/after.
6. "Restore last alignment" moves the SOURCE back to where it was.
The window can be switched between Italian and English.

Uninstall
---------
Tools > Options > Plug-ins > select ScanAlignRhino > Uninstall, then close
Rhino and delete the folder.

Troubleshooting
---------------
- The command does not start or reports a missing file: check that
  MathNet.Numerics.dll is in the same folder as the .rhp and that the zip was
  unblocked (step 1).
- The toolbar button shows no icon: known limitation of the new Rhino 9
  toolbars; the ScanAlign command works anyway.
